<%@ Page Language="C#" MasterPageFile="~/admin/HO/HOMP.master" AutoEventWireup="true" CodeFile="ManagementRoute.aspx.cs" Inherits="admin_HO_ManagementBranch" Title="Routes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="body_page" Runat="Server">
<asp:Label Font-Bold=true ID="lblthongbao" runat="server"></asp:Label>
<asp:Panel runat="server" ID="pnList" Width="100%">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="table" DataSourceID="dsBranch" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="RouteID">
        <Columns>
            <asp:BoundField DataField="StartPoint" HeaderText="Start Point" SortExpression="StartPoint" />
            <asp:BoundField DataField="EndPoint" HeaderText="End Point" SortExpression="EndPoint" />
            <asp:TemplateField HeaderText="Action" ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
                        Text="Edit"></asp:LinkButton>
                        <%# @"|| <a href='?act=del&rID="+Eval("RouteID").ToString()+"' onclick='return conf()'>Delete</a>" %>
                </ItemTemplate>
            </asp:TemplateField>
            
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="dsBranch" runat="server" ConnectionString="<%$ ConnectionStrings:ketnoi2 %>"
        SelectCommand="SELECT * FROM [Routes]"></asp:SqlDataSource>
    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Create new Route" /></asp:Panel>
<asp:Panel ID="pnCreate" runat="server" Width="100%" Visible="False">
    <table class="table2" style="width: 100%">
    <tr><td colspan=2>
        <asp:Label ID="lblTitleForm" runat="server" Text="Create new route "></asp:Label>
        <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label></td></tr>
        <tr>
            <td style="width: 30%; height: 27px">
                Start point</td>
            <td style="width: 70%; height: 27px">
                <asp:TextBox ID="txtStart" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="width: 30%; height: 27px">
                End point</td>
            <td style="width: 70%; height: 27px">
                <asp:TextBox ID="txtEnd" runat="server"></asp:TextBox></td>
        </tr>
        
        <tr>
            <td style="width: 30%; height: 27px">
            </td>
            <td style="width: 70%; height: 27px">
                <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
                <asp:Button ID="btnCreate" runat="server" Text="Create" OnClick="btnCreate_Click" />
               </td>
        </tr>
    </table>
</asp:Panel>    
<script>
function conf()
{
return confirm("Are you sure?");
}
</script>
</asp:Content>

